package com.itmaima.controller;

import com.itmaima.service.UserService;
import model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/user-save")
    @ResponseBody
    public User save(){
        userService.save();
        return createUser();
    }

    private User createUser(){
        User user = new User();
        user.setName("hello world");
        return user;

    }
}
